-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yarn.ps1, fixes #6092 (bad Ctrl C behavior) #6093
Conversation
Can you detail what you mean with "the termination behavior (Ctrl C) for cmd scripts cannot be modifed"? What exactly doesn't work? |
Hi Arcanis! You can see the discussion with Microsoft re |
What do you think about microsoft/terminal#217 (comment)? It seems like a valid concern.
|
@arcanis Comment is accurate but doesn't affect anything:
The purpose of the |
I'm the one with the concerned comment. I just did an experiment and found that PowerShell will pick a .ps1 file before a .cmd, so rather than replace the script, can you just add the PowerShell script? That should give you working ^C behavior in PowerShell without breaking cmd. |
@mikemaccana quick question - are you proposing that the I followed the discussion here and came to this issue. I created a But if I remove the |
@kumarharsh not sure what the purpose of the Are you using the |
I created a |
Fwiw I hate* powershell even more than I hate cmd, so I tend to use cmd at home. I doubt I'm the only one, so I'd say it's safer to keep both. (*) Hate is a strong word tbh, it's just that I never got the time to learn the Powershell syntaxes, and I mostly use WSL nowadays anyway, so it's not a priority. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please commit back the cmd file
Keeping A common method of determining whether a file is executable in Windows is to compare its file extension with the extensions listed in the
|
Fixes yarnpkg#6902. Leave in yarn.cmd in case anyone is still using cmd on Windows in 2018.
|
As requested, I've updated the PR and left yarn.cmd for any people still running cmd. |
Relevant discussion on npm: npm/rfcs#20 |
Perfect, thanks! |
function Get-ScriptDirectory { | ||
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | ||
Split-Path $Invocation.MyCommand.Path | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any difference between the output of this function and $PSScriptRoot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$PSScriptRoot
may not have been considered because it was introduced in PowerShell 3. It would not work for users of older versions of PowerShell.
Edit: Sorry, forgot to answer your question. No, I don't believe there is any difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the author $PSScriptRoot
wasn't considered because I just learnt about it from @felixfbecker. 😀 Do we want to support Windows 7 default (Powershell 2) or not though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $PSScriptRoot
was introduced in PS 3 that would mean it is not supported in Windows 7 - I don't know what the support policy is here from yarn / NodeJS?
I use |
@waynebloss npm always uses |
@felixfbecker OK, thanks. I'm not sure if that was always the case or not - I've been using Node since very early on in Windows and well, regardless of what I do with |
… #6092
Summary
Not a substantial pull request.
cmd
is unmaintained, according to its authors at Microsoft. One of the issues is that the termination behavior (Ctrl C) forcmd
scripts cannot be modifed, but there are likely other issues withcmd
being unmaintained.Test plan
All Windows
yarn
commands still work, with no effect on speed and output.